import request from '@/utils/request.js'

export const userGetBasicInfos = email => request.get('/api/user/getBasicInfos', { params: { email } })

export const userUpdateUserInfos = ({
  userId,
  username,
  email,
  gender,
  birthdate,
  bio,
  avatar,
  region,
  musicLink,
  socialMedia
}) =>
  request.put('/api/user/updateUserInfos', {
    userId,
    username,
    email,
    gender,
    birthdate,
    bio,
    avatar,
    region,
    musicLink,
    socialMedia
  })

export const userUpdatePassword = ({ email, password, oldPassword, newPassword, confirmPassword }) =>
  request.put('/api/user/updatePassword', {
    email,
    password,
    oldPassword,
    newPassword,
    confirmPassword
  })
